layui.define(["layer"], function(f) {
  var $ = layui.jquery;
  var layer = layui.layer;
  var CLS_LAYBODY = ".layui-layout-admin>.layui-body";
  var CLS_LAYTAB = CLS_LAYBODY + ">.layui-tab";
  var CLS_SIDESCROLL = ".layui-layout-admin>.layui-side>.layui-side-scroll";
  var CLS_LAYHEAD = ".layui-layout-admin>.layui-header";
  var b = "admin-pagetabs";
  var CLS_SIDENAV = "admin-side-nav";
  var CLS_THEME_ADMIN = "theme-admin";
  var admin = {
      version: "314",
      defaultTheme: "theme-admin",
      tableName: "easyweb",
      flexible: function(n) {
          if (window != top && !admin.isTop()) {
              if (top.layui && top.layui.admin) {
                  top.layui.admin.flexible(n);
                  return
              }
          }
          var o = $(".layui-layout-admin").hasClass("admin-nav-mini");
          (n == undefined) && (n = o);
          if (o == n) {
              if (n) {
                  admin.hideTableScrollBar();
                  $(".layui-layout-admin").removeClass("admin-nav-mini")
              } else {
                  $(".layui-layout-admin").addClass("admin-nav-mini")
              }
          }
      },
      activeNav: function(path) {
          if (window != top && !admin.isTop()) {
              if (top.layui && top.layui.admin) {
                  top.layui.admin.activeNav(path);
                  return
              }
          }
          if (!path) {
              path = window.location.pathname;
              path = path.substring(path.indexOf("/"))
          }
          if (path && path != "") {
              $(CLS_SIDESCROLL + ">.layui-nav .layui-nav-item .layui-nav-child dd.layui-this").removeClass("layui-this");
              $(CLS_SIDESCROLL + ">.layui-nav .layui-nav-item.layui-this").removeClass("layui-this");
              var $activeNav = $(CLS_SIDESCROLL + '>.layui-nav a[lay-href="' + path + '"]');
              if ($activeNav && $activeNav.length > 0) {
                  var isCollapse = $(".layui-layout-admin").hasClass("admin-nav-mini");
                  if ($(CLS_SIDESCROLL + ">.layui-nav").attr("lay-accordion") == "true") {
                      var n = $activeNav.parent("dd").parents(".layui-nav-child");
                      if (isCollapse) {
                          $(CLS_SIDESCROLL + ">.layui-nav .layui-nav-itemed>.layui-nav-child").not(n).css("display", "none")
                      } else {
                          $(CLS_SIDESCROLL + ">.layui-nav .layui-nav-itemed>.layui-nav-child").not(n).slideUp("fast")
                      }
                      $(CLS_SIDESCROLL + ">.layui-nav .layui-nav-itemed").not(n.parent()).removeClass("layui-nav-itemed")
                  }
                  $activeNav.parent().addClass("layui-this");
                  var s = $activeNav.parent("dd").parents(".layui-nav-child").parent();
                  if (isCollapse) {
                      s.not(".layui-nav-itemed").children(".layui-nav-child").css("display", "block")
                  } else {
                      s.not(".layui-nav-itemed").children(".layui-nav-child").slideDown("fast", function() {
                          var t = $activeNav.offset().top + $activeNav.outerHeight() + 30 - admin.getPageHeight();
                          var u = 50 + 65 - $activeNav.offset().top;
                          if (t > 0) {
                              $(CLS_SIDESCROLL).animate({
                                  "scrollTop": $(CLS_SIDESCROLL).scrollTop() + t
                              }, 100)
                          } else {
                              if (u > 0) {
                                  $(CLS_SIDESCROLL).animate({
                                      "scrollTop": $(CLS_SIDESCROLL).scrollTop() - u
                                  }, 100)
                              }
                          }
                      })
                  }
                  s.addClass("layui-nav-itemed");
                  $('ul[lay-filter="' + CLS_SIDENAV + '"]').addClass("layui-hide");
                  var p = $activeNav.parents(".layui-nav");
                  p.removeClass("layui-hide");
                  $(CLS_LAYHEAD + ">.layui-nav>.layui-nav-item").removeClass("layui-this");
                  $(CLS_LAYHEAD + '>.layui-nav>.layui-nav-item>a[nav-bind="' + p.attr("nav-id") + '"]').parent().addClass("layui-this")
              } else {}
          } else {
              console.warn("active url is null")
          }
      },
      popupRight: function(options) {
          if (options.title == undefined) {
              options.title = false;
              options.closeBtn = false
          }
          if (options.fixed == undefined) {
              options.fixed = true
          }
          options.anim = -1;
          options.offset = "r";
          options.shadeClose = true;
          options.area || (options.area = "336px");
          options.skin || (options.skin = "layui-anim layui-anim-rl layui-layer-adminRight");
          options.move = false;
          return admin.open(options)
      },
      open: function(options) {
          if (!options.area) {
              options.area = (options.type == 2) ? ["360px", "300px"] : "360px"
          }
          if (!options.skin) {
              options.skin = "layui-layer-admin"
          }
          if (!options.offset) {
              if (admin.getPageWidth() < 768) {
                  options.offset = "15px"
              } else {
                  if (window == top) {
                      options.offset = "70px"
                  } else {
                      options.offset = "40px"
                  }
              }
          }
          if (options.fixed == undefined) {
              options.fixed = false
          }
          options.resize = options.resize != undefined ? options.resize : false;
          options.shade = options.shade != undefined ? options.shade : 0.1;
          var endCall = options.end;
          options.end = function() {
              layer.closeAll("tips");
              endCall && endCall()
          };
          if (options.url) {
              (options.type == undefined) && (options.type = 1);
              var successCall = options.success;
              options.success = function(layero, index) {
                  admin.showLoading(layero, 2);
                  $(layero).children(".layui-layer-content").load(options.url, function() {
                      successCall ? successCall(layero, index) : "";
                      admin.removeLoading(layero, false)
                  })
              }
          }
          var n = layer.open(options);
          (options.data) && (admin.layerData["d" + n] = options.data);
          return n
      },
      layerData: {},
      getLayerData: function(n, o) {
          if (n == undefined) {
              n = parent.layer.getFrameIndex(window.name);
              return parent.layui.admin.getLayerData(n, o)
          } else {
              if (n.toString().indexOf("#") == 0) {
                  n = $(n).parents(".layui-layer").attr("id").substring(11)
              }
          }
          var p = admin.layerData["d" + n];
          if (o) {
              return p ? p[o] : p
          }
          return p
      },
      putLayerData: function(o, q, n) {
          if (n == undefined) {
              n = parent.layer.getFrameIndex(window.name);
              return parent.layui.admin.putLayerData(o, q, n)
          } else {
              if (n.toString().indexOf("#") == 0) {
                  n = $(n).parents(".layui-layer").attr("id").substring(11)
              }
          }
          var p = admin.getLayerData(n);
          p || (p = {});
          p[o] = q
      },
      req: function(n, o, p, q) {
          admin.ajax({
              url: n,
              data: o,
              type: q,
              dataType: "json",
              success: p
          })
      },
      ajax: function(options) {
          var headers = options.header;
          options.dataType || (options.dataType = "json");
          var successCall = options.success;
          options.success = function(response, r, t) {
              var _response;
              if ("json" == options.dataType.toLowerCase()) {
                  _response = response
              } else {
                  _response = admin.parseJSON(response)
              }
              _response && (_response = response);
              if (admin.ajaxSuccessBefore(_response, options.url) == false) {
                  return
              }
              successCall(response, r, t)
          };
          options.error = function(q) {
              options.success({
                  code: q.status,
                  msg: q.statusText
              })
          };
          options.beforeSend = function(t) {
              var s = admin.getAjaxHeaders(options.url);
              for (var q = 0; q < s.length; q++) {
                  t.setRequestHeader(s[q].name, s[q].value)
              }
              if (headers) {
                  for (var r in headers) {
                      t.setRequestHeader(r, headers[r])
                  }
              }
          };
          $.ajax(options)
      },
      parseJSON: function(p) {
          if (typeof p == "string") {
              try {
                  var o = JSON.parse(p);
                  if (typeof o == "object" && o) {
                      return o
                  }
              } catch (n) {}
          }
      },
      showLoading: function(r, q, o) {
          var p;
          if (r != undefined && (typeof r != "string") && !(r instanceof $)) {
              q = r.type;
              o = r.opacity;
              p = r.size;
              r = r.elem
          }(!r) && (r = "body");
          (q == undefined) && (q = 1);
          (p == undefined) && (p = "sm");
          p = " " + p;
          var n = ['<div class="ball-loader' + p + '"><span></span><span></span><span></span><span></span></div>', '<div class="rubik-loader' + p + '"></div>', '<div class="signal-loader' + p + '"><span></span><span></span><span></span><span></span></div>'];
          $(r).addClass("page-no-scroll");
          var s = $(r).children(".page-loading");
          if (s.length <= 0) {
              $(r).append('<div class="page-loading">' + n[q - 1] + "</div>");
              s = $(r).children(".page-loading")
          }
          o && s.css("background-color", "rgba(255,255,255," + o + ")");
          s.show()
      },
      removeLoading: function(o, q, n) {
          if (!o) {
              o = "body"
          }
          if (q == undefined) {
              q = true
          }
          var p = $(o).children(".page-loading");
          if (n) {
              p.remove()
          } else {
              q ? p.fadeOut() : p.hide()
          }
          $(o).removeClass("page-no-scroll")
      },
      putTempData: function(o, p) {
          var n = admin.tableName + "_tempData";
          if (p != undefined && p != null) {
              layui.sessionData(n, {
                  key: o,
                  value: p
              })
          } else {
              layui.sessionData(n, {
                  key: o,
                  remove: true
              })
          }
      },
      getTempData: function(o) {
          var n = admin.tableName + "_tempData";
          var p = layui.sessionData(n);
          if (p) {
              return p[o]
          } else {
              return false
          }
      },
      rollPage: function(q) {
          if (window != top && !admin.isTop()) {
              if (top.layui && top.layui.admin) {
                  top.layui.admin.rollPage(q);
                  return
              }
          }
          var o = $(CLS_LAYTAB + ">.layui-tab-title");
          var p = o.scrollLeft();
          if ("left" === q) {
              o.animate({
                  "scrollLeft": p - 120
              }, 100)
          } else {
              if ("auto" === q) {
                  var n = 0;
                  o.children("li").each(function() {
                      if ($(this).hasClass("layui-this")) {
                          return false
                      } else {
                          n += $(this).outerWidth()
                      }
                  });
                  o.animate({
                      "scrollLeft": n - 120
                  }, 100)
              } else {
                  o.animate({
                      "scrollLeft": p + 120
                  }, 100)
              }
          }
      },
      refresh: function(n) {
          if (window != top && !admin.isTop()) {
              if (top.layui && top.layui.admin) {
                  top.layui.admin.refresh(n);
                  return
              }
          }
          var p;
          if (!n) {
              p = $(CLS_LAYTAB + ">.layui-tab-content>.layui-tab-item.layui-show>.admin-iframe");
              if (!p || p.length <= 0) {
                  p = $(CLS_LAYBODY + ">div>.admin-iframe")
              }
          } else {
              p = $(CLS_LAYTAB + '>.layui-tab-content>.layui-tab-item>.admin-iframe[lay-id="' + n + '"]');
              if (!p || p.length <= 0) {
                  p = $(CLS_LAYBODY + ">.admin-iframe")
              }
          } if (p && p[0]) {
              try {
                  p[0].contentWindow.location.reload(true)
              } catch (o) {
                  p.attr("src", p.attr("src"))
              }
          } else {
              console.warn(n + " is not found")
          }
      },
      closeThisTabs: function(n) {
          if (window != top && !admin.isTop()) {
              if (top.layui && top.layui.admin) {
                  top.layui.admin.closeThisTabs(n);
                  return
              }
          }
          admin.closeTabOperNav();
          var o = $(CLS_LAYTAB + ">.layui-tab-title");
          if (!n) {
              if (o.find("li").first().hasClass("layui-this")) {
                  layer.msg("主页不能关闭", {
                      icon: 2
                  });
                  return
              }
              o.find("li.layui-this").find(".layui-tab-close").trigger("click")
          } else {
              if (n == o.find("li").first().attr("lay-id")) {
                  layer.msg("主页不能关闭", {
                      icon: 2
                  });
                  return
              }
              o.find('li[lay-id="' + n + '"]').find(".layui-tab-close").trigger("click")
          }
      },
      closeOtherTabs: function(n) {
          if (window != top && !admin.isTop()) {
              if (top.layui && top.layui.admin) {
                  top.layui.admin.closeOtherTabs(n);
                  return
              }
          }
          if (!n) {
              $(CLS_LAYTAB + ">.layui-tab-title li:gt(0):not(.layui-this)").find(".layui-tab-close").trigger("click")
          } else {
              $(CLS_LAYTAB + ">.layui-tab-title li:gt(0)").each(function() {
                  if (n != $(this).attr("lay-id")) {
                      $(this).find(".layui-tab-close").trigger("click")
                  }
              })
          }
          admin.closeTabOperNav()
      },
      closeAllTabs: function() {
          if (window != top && !admin.isTop()) {
              if (top.layui && top.layui.admin) {
                  top.layui.admin.closeAllTabs();
                  return
              }
          }
          $(CLS_LAYTAB + ">.layui-tab-title li:gt(0)").find(".layui-tab-close").trigger("click");
          $(CLS_LAYTAB + ">.layui-tab-title li:eq(0)").trigger("click");
          admin.closeTabOperNav()
      },
      closeTabOperNav: function() {
          if (window != top && !admin.isTop()) {
              if (top.layui && top.layui.admin) {
                  top.layui.admin.closeTabOperNav();
                  return
              }
          }
          $(".layui-icon-down .layui-nav .layui-nav-child").removeClass("layui-show")
      },
      changeTheme: function(t) {
          if (t) {
              layui.data(admin.tableName, {
                  key: "theme",
                  value: t
              });
              if (CLS_THEME_ADMIN == t) {
                  t = undefined
              }
          } else {
              layui.data(admin.tableName, {
                  key: "theme",
                  remove: true
              })
          }
          try {
              admin.removeTheme(top);
              (t && top.layui) && top.layui.link(admin.getThemeDir() + t + admin.getCssSuffix(), t);
              var u = top.window.frames;
              for (var p = 0; p < u.length; p++) {
                  try {
                      var r = u[p];
                      admin.removeTheme(r);
                      if (t && r.layui) {
                          r.layui.link(admin.getThemeDir() + t + admin.getCssSuffix(), t)
                      }
                      var q = r.frames;
                      for (var o = 0; o < q.length; o++) {
                          try {
                              var n = q[o];
                              admin.removeTheme(n);
                              if (t && n.layui) {
                                  n.layui.link(admin.getThemeDir() + t + admin.getCssSuffix(), t)
                              }
                          } catch (s) {}
                      }
                  } catch (s) {}
              }
          } catch (s) {}
      },
      removeTheme: function(n) {
          if (!n) {
              n = window
          }
          if (n.layui) {
              var o = "layuicss-theme";
              n.layui.jquery('link[id^="' + o + '"]').remove()
          }
      },
      getThemeDir: function() {
          return layui.cache.base + "theme/"
      },
      closeThisDialog: function() {
          parent.layer.close(parent.layer.getFrameIndex(window.name))
      },
      closeDialog: function(n) {
          var o = $(n).parents(".layui-layer").attr("id").substring(11);
          layer.close(o)
      },
      iframeAuto: function() {
          parent.layer.iframeAuto(parent.layer.getFrameIndex(window.name))
      },
      getPageHeight: function() {
          return document.documentElement.clientHeight || document.body.clientHeight
      },
      getPageWidth: function() {
          return document.documentElement.clientWidth || document.body.clientWidth
      },
      getCssSuffix: function() {
          var n = ".css";
          if (admin.version != undefined) {
              n += "?v=";
              if (admin.version == true) {
                  n += new Date().getTime()
              } else {
                  n += admin.version
              }
          }
          return n
      },
      hideTableScrollBar: function(p) {
          if (admin.getPageWidth() > 768) {
              if (!p) {
                  var o = $(CLS_LAYTAB + ">.layui-tab-content>.layui-tab-item.layui-show>.admin-iframe");
                  if (o.length <= 0) {
                      o = $(CLS_LAYBODY + ">div>.admin-iframe")
                  }
                  if (o.length > 0) {
                      p = o[0].contentWindow
                  }
              }
              try {
                  if (p && p.layui && p.layui.jquery) {
                      if (window.hsbTimer) {
                          clearTimeout(hsbTimer)
                      }
                      p.layui.jquery(".layui-table-body.layui-table-main").addClass("no-scrollbar");
                      window.hsbTimer = setTimeout(function() {
                          if (p && p.layui && p.layui.jquery) {
                              p.layui.jquery(".layui-table-body.layui-table-main").removeClass("no-scrollbar")
                          }
                      }, 500)
                  }
              } catch (n) {}
          }
      },
      modelForm: function(o, r, n) {
          var q = $(o);
          q.addClass("layui-form");
          if (n) {
              q.attr("lay-filter", n)
          }
          var p = q.find(".layui-layer-btn .layui-layer-btn0");
          p.attr("lay-submit", "");
          p.attr("lay-filter", r)
      },
      btnLoading: function(o, p, q) {
          if (p != undefined && (typeof p == "boolean")) {
              q = p;
              p = undefined
          }(q == undefined) && (q = true);
          var n = $(o);
          if (q) {
              p && n.html(p);
              n.find(".layui-icon").addClass("layui-hide");
              n.addClass("icon-btn");
              n.prepend('<i class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop ew-btn-loading"></i>');
              n.prop("disabled", "disabled")
          } else {
              n.find(".ew-btn-loading").remove();
              n.removeProp("disabled", "disabled");
              if (n.find(".layui-icon.layui-hide").length <= 0) {
                  n.removeClass("icon-btn")
              }
              n.find(".layui-icon").removeClass("layui-hide");
              p && n.html(p)
          }
      },
      openSideAutoExpand: function() {
          $(".layui-layout-admin>.layui-side").off("mouseenter.openSideAutoExpand").on("mouseenter.openSideAutoExpand", function() {
              if ($(this).parent().hasClass("admin-nav-mini")) {
                  admin.flexible(true);
                  $(this).addClass("side-mini-hover")
              }
          });
          $(".layui-layout-admin>.layui-side").off("mouseleave.openSideAutoExpand").on("mouseleave.openSideAutoExpand", function() {
              if ($(this).hasClass("side-mini-hover")) {
                  admin.flexible(false);
                  $(this).removeClass("side-mini-hover")
              }
          })
      },
      openCellAutoExpand: function() {
          $("body").off("mouseenter.openCellAutoExpand").on("mouseenter.openCellAutoExpand", ".layui-table-view td", function() {
              $(this).find(".layui-table-grid-down").trigger("click")
          });
          $("body").off("mouseleave.openCellAutoExpand").on("mouseleave.openCellAutoExpand", ".layui-table-tips>.layui-layer-content", function() {
              $(".layui-table-tips-c").trigger("click")
          })
      },
      isTop: function() {
          return $(CLS_LAYBODY).length > 0
      },
      strToWin: function(q) {
          var p = window;
          if (q) {
              var n = q.split(".");
              for (var o = 0; o < n.length; o++) {
                  p = p[n[o]]
              }
          }
          return p
      },
      parseLayerOption: function(options) {
          for (var key in options) {
              if (options[key] && options[key].toString().indexOf(",") != -1) {
                  options[key] = options[key].toString().split(",")
              }
          }
          var functions = ["success", "cancel", "end", "full", "min", "restore"];
          for (var i = 0; i < functions.length; i++) {
              for (var key in options) {
                  if (key == functions[i]) {
                      options[key] = window[options[key]]
                  }
              }
          }
          if (options.content && (typeof options.content === "string") && options.content.indexOf("#") == 0) {
              options.content = $(options.content).html()
          }(options.type == undefined) && (options.type = 2);
          return options
      },
      ajaxSuccessBefore: function(n, o) {
          return true
      },
      getAjaxHeaders: function(n) {
          var o = new Array();
          return o
      }
  };
  admin.events = {
      flexible: function() {
          admin.strToWin($(this).data("window")).layui.admin.flexible()
      },
      refresh: function() {
          admin.strToWin($(this).data("window")).layui.admin.refresh()
      },
      back: function() {
          admin.strToWin($(this).data("window")).history.back()
      },
      theme: function() {
          var n = $(this).data("url");
          admin.strToWin($(this).data("window")).layui.admin.popupRight({
              id: "layer-theme",
              type: 2,
              content: n ? n : "page/tpl/tpl-theme.html"
          })
      },
      note: function() {
          var n = $(this).data("url");
          admin.strToWin($(this).data("window")).layui.admin.popupRight({
              id: "layer-note",
              title: "便签",
              type: 2,
              closeBtn: false,
              content: n ? n : "page/tpl/tpl-note.html"
          })
      },
      message: function() {
          var n = $(this).data("url");
          admin.strToWin($(this).data("window")).layui.admin.popupRight({
              id: "layer-notice",
              type: 2,
              content: n ? n : "page/tpl/tpl-message.html"
          })
      },
      psw: function() {
          var n = $(this).data("url");
          admin.strToWin($(this).data("window")).layui.admin.open({
              id: "pswForm",
              type: 2,
              title: "修改密码",
              area: ["360px", "287px"],
              shade: 0,
              content: n ? n : "page/tpl/tpl-password.html"
          })
      },
      logout: function() {
          var n = $(this).data("url");
          admin.strToWin($(this).data("window")).layui.layer.confirm("确定要退出登录吗？", {
              title: "温馨提示",
              skin: "layui-layer-admin"
          }, function() {
              location.replace(n ? n : "/")
          })
      },
      open: function() {
          var n = $(this).data();
          admin.strToWin(n.window).layui.admin.open(admin.parseLayerOption(admin.util.deepClone(n)))
      },
      popupRight: function() {
          var n = $(this).data();
          admin.strToWin(n.window).layui.admin.popupRight(admin.parseLayerOption(admin.util.deepClone(n)))
      },
      fullScreen: function() {
          var u = "layui-icon-screen-full",
              n = "layui-icon-screen-restore";
          var r = $(this).find("i");
          var q = document.fullscreenElement || document.msFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || false;
          if (q) {
              var p = document.exitFullscreen || document.webkitExitFullscreen || document.mozCancelFullScreen || document.msExitFullscreen;
              if (p) {
                  p.call(document)
              } else {
                  if (window.ActiveXObject) {
                      var o = new ActiveXObject("WScript.Shell");
                      o && o.SendKeys("{F11}")
                  }
              }
              r.addClass(u).removeClass(n)
          } else {
              var s = document.documentElement;
              var t = s.requestFullscreen || s.webkitRequestFullscreen || s.mozRequestFullScreen || s.msRequestFullscreen;
              if (t) {
                  t.call(s)
              } else {
                  if (window.ActiveXObject) {
                      var o = new ActiveXObject("WScript.Shell");
                      o && o.SendKeys("{F11}")
                  }
              }
              r.addClass(n).removeClass(u)
          }
      },
      leftPage: function() {
          admin.strToWin($(this).data("window")).layui.admin.rollPage("left")
      },
      rightPage: function() {
          admin.strToWin($(this).data("window")).layui.admin.rollPage()
      },
      closeThisTabs: function() {
          var n = $(this).data("url");
          admin.strToWin($(this).data("window")).layui.admin.closeThisTabs(n)
      },
      closeOtherTabs: function() {
          admin.strToWin($(this).data("window")).layui.admin.closeOtherTabs()
      },
      closeAllTabs: function() {
          admin.strToWin($(this).data("window")).layui.admin.closeAllTabs()
      },
      closeDialog: function() {
          admin.closeThisDialog()
      },
      closePageDialog: function() {
          admin.closeDialog(this)
      }
  };
  admin.chooseLocation = function(s) {
      var o = s.title;
      var w = s.onSelect;
      var q = s.needCity;
      var x = s.center;
      var A = s.defaultZoom;
      var t = s.pointZoom;
      var v = s.keywords;
      var z = s.pageSize;
      var r = s.mapJsUrl;
      (o == undefined) && (o = "选择位置");
      (A == undefined) && (A = 11);
      (t == undefined) && (t = 17);
      (v == undefined) && (v = "");
      (z == undefined) && (z = 30);
      (r == undefined) && (r = "https://webapi.amap.com/maps?v=1.4.14&key=006d995d433058322319fa797f2876f5");
      var B = false,
          y;
      var u = function(D, C) {
          AMap.service(["AMap.PlaceSearch"], function() {
              var F = new AMap.PlaceSearch({
                  type: "",
                  pageSize: z,
                  pageIndex: 1
              });
              var E = [C, D];
              F.searchNearBy(v, E, 1000, function(H, G) {
                  if (H == "complete") {
                      var K = G.poiList.pois;
                      var L = "";
                      for (var J = 0; J < K.length; J++) {
                          var I = K[J];
                          if (I.location != undefined) {
                              L += '<div data-lng="' + I.location.lng + '" data-lat="' + I.location.lat + '" class="ew-map-select-search-list-item">';
                              L += '     <div class="ew-map-select-search-list-item-title">' + I.name + "</div>";
                              L += '     <div class="ew-map-select-search-list-item-address">' + I.address + "</div>";
                              L += '     <div class="ew-map-select-search-list-item-icon-ok layui-hide"><i class="layui-icon layui-icon-ok-circle"></i></div>';
                              L += "</div>"
                          }
                      }
                      $("#ew-map-select-pois").html(L)
                  }
              })
          })
      };
      var n = function() {
          var C = {
              resizeEnable: true,
              zoom: A
          };
          x && (C.center = x);
          var D = new AMap.Map("ew-map-select-map", C);
          D.on("complete", function() {
              var E = D.getCenter();
              u(E.lat, E.lng)
          });
          D.on("moveend", function() {
              if (B) {
                  B = false
              } else {
                  $("#ew-map-select-tips").addClass("layui-hide");
                  $("#ew-map-select-center-img").removeClass("bounceInDown");
                  setTimeout(function() {
                      $("#ew-map-select-center-img").addClass("bounceInDown")
                  });
                  var E = D.getCenter();
                  u(E.lat, E.lng)
              }
          });
          $("#ew-map-select-pois").off("click").on("click", ".ew-map-select-search-list-item", function() {
              $("#ew-map-select-tips").addClass("layui-hide");
              $("#ew-map-select-pois .ew-map-select-search-list-item-icon-ok").addClass("layui-hide");
              $(this).find(".ew-map-select-search-list-item-icon-ok").removeClass("layui-hide");
              $("#ew-map-select-center-img").removeClass("bounceInDown");
              setTimeout(function() {
                  $("#ew-map-select-center-img").addClass("bounceInDown")
              });
              var G = $(this).data("lng");
              var H = $(this).data("lat");
              var F = $(this).find(".ew-map-select-search-list-item-title").text();
              var E = $(this).find(".ew-map-select-search-list-item-address").text();
              y = {
                  name: F,
                  address: E,
                  lat: H,
                  lng: G
              };
              B = true;
              D.setZoomAndCenter(t, [G, H])
          });
          $("#ew-map-select-btn-ok").click(function() {
              if (y == undefined) {
                  layer.msg("请点击位置列表选择", {
                      icon: 2,
                      anim: 6
                  })
              } else {
                  if (w) {
                      if (q) {
                          var E = layer.load(2);
                          D.setCenter([y.lng, y.lat]);
                          D.getCity(function(F) {
                              layer.close(E);
                              y.city = F;
                              admin.closeDialog("#ew-map-select-btn-ok");
                              w(y)
                          })
                      } else {
                          admin.closeDialog("#ew-map-select-btn-ok");
                          w(y)
                      }
                  } else {
                      admin.closeDialog("#ew-map-select-btn-ok")
                  }
              }
          });
          $("#ew-map-select-input-search").off("input").on("input", function() {
              var E = $(this).val();
              if (!E) {
                  $("#ew-map-select-tips").html("");
                  $("#ew-map-select-tips").addClass("layui-hide")
              }
              AMap.plugin("AMap.Autocomplete", function() {
                  var F = new AMap.Autocomplete({
                      city: "全国"
                  });
                  F.search(E, function(I, H) {
                      if (H.tips) {
                          var G = H.tips;
                          var K = "";
                          for (var J = 0; J < G.length; J++) {
                              var L = G[J];
                              if (L.location != undefined) {
                                  K += '<div data-lng="' + L.location.lng + '" data-lat="' + L.location.lat + '" class="ew-map-select-search-list-item">';
                                  K += '     <div class="ew-map-select-search-list-item-icon-search"><i class="layui-icon layui-icon-search"></i></div>';
                                  K += '     <div class="ew-map-select-search-list-item-title">' + L.name + "</div>";
                                  K += '     <div class="ew-map-select-search-list-item-address">' + L.address + "</div>";
                                  K += "</div>"
                              }
                          }
                          $("#ew-map-select-tips").html(K);
                          if (G.length == 0) {
                              $("#ew-map-select-tips").addClass("layui-hide")
                          } else {
                              $("#ew-map-select-tips").removeClass("layui-hide")
                          }
                      } else {
                          $("#ew-map-select-tips").html("");
                          $("#ew-map-select-tips").addClass("layui-hide")
                      }
                  })
              })
          });
          $("#ew-map-select-input-search").off("blur").on("blur", function() {
              var E = $(this).val();
              if (!E) {
                  $("#ew-map-select-tips").html("");
                  $("#ew-map-select-tips").addClass("layui-hide")
              }
          });
          $("#ew-map-select-input-search").off("focus").on("focus", function() {
              var E = $(this).val();
              if (E) {
                  $("#ew-map-select-tips").removeClass("layui-hide")
              }
          });
          $("#ew-map-select-tips").off("click").on("click", ".ew-map-select-search-list-item", function() {
              $("#ew-map-select-tips").addClass("layui-hide");
              var E = $(this).data("lng");
              var F = $(this).data("lat");
              y = undefined;
              D.setZoomAndCenter(t, [E, F])
          })
      };
      var p = '<div class="ew-map-select-tool" style="position: relative;">';
      p += '        搜索：<input id="ew-map-select-input-search" class="layui-input icon-search inline-block" style="width: 190px;" placeholder="输入关键字搜索" autocomplete="off" />';
      p += '        <button id="ew-map-select-btn-ok" class="layui-btn icon-btn pull-right" type="button"><i class="layui-icon">&#xe605;</i>确定</button>';
      p += '        <div id="ew-map-select-tips" class="ew-map-select-search-list layui-hide">';
      p += "        </div>";
      p += "   </div>";
      p += '   <div class="layui-row ew-map-select">';
      p += '        <div class="layui-col-sm7 ew-map-select-map-group" style="position: relative;">';
      p += '             <div id="ew-map-select-map"></div>';
      p += '             <i id="ew-map-select-center-img2" class="layui-icon layui-icon-add-1"></i>';
      p += '             <img id="ew-map-select-center-img" src="https://3gimg.qq.com/lightmap/components/locationPicker2/image/marker.png"/>';
      p += "        </div>";
      p += '        <div id="ew-map-select-pois" class="layui-col-sm5 ew-map-select-search-list">';
      p += "        </div>";
      p += "   </div>";
      admin.open({
          id: "ew-map-select",
          type: 1,
          title: o,
          area: "750px",
          content: p,
          success: function(C, E) {
              var D = $(C).children(".layui-layer-content");
              D.css("overflow", "visible");
              admin.showLoading(D);
              if (undefined == window.AMap) {
                  $.getScript(r, function() {
                      n();
                      admin.removeLoading(D)
                  })
              } else {
                  n();
                  admin.removeLoading(D)
              }
          }
      })
  };
  admin.cropImg = function(q) {
      var o = "image/jpeg";
      var v = q.aspectRatio;
      var w = q.imgSrc;
      var t = q.imgType;
      var r = q.onCrop;
      var s = q.limitSize;
      var u = q.acceptMime;
      var p = q.exts;
      var n = q.title;
      (v == undefined) && (v = 1 / 1);
      (n == undefined) && (n = "裁剪图片");
      t && (o = t);
      layui.use(["Cropper", "upload"], function() {
          var y = layui.Cropper;
          var x = layui.upload;

          function z() {
              var C, D = $("#ew-crop-img");
              var E = {
                  elem: "#ew-crop-img-upload",
                  auto: false,
                  drag: false,
                  choose: function(F) {
                      F.preview(function(H, I, G) {
                          o = I.type;
                          D.attr("src", G);
                          if (!w || !C) {
                              w = G;
                              z()
                          } else {
                              C.destroy();
                              C = new y(D[0], B)
                          }
                      })
                  }
              };
              (s != undefined) && (E.size = s);
              (u != undefined) && (E.acceptMime = u);
              (p != undefined) && (E.exts = p);
              x.render(E);
              if (!w) {
                  $("#ew-crop-img-upload").trigger("click");
                  return
              }
              var B = {
                  aspectRatio: v,
                  preview: "#ew-crop-img-preview"
              };
              C = new y(D[0], B);
              $(".ew-crop-tool").on("click", "[data-method]", function() {
                  var G = $(this).data(),
                      H, F;
                  if (!C || !G.method) {
                      return
                  }
                  G = $.extend({}, G);
                  H = C.cropped;
                  switch (G.method) {
                      case "rotate":
                          if (H && B.viewMode > 0) {
                              C.clear()
                          }
                          break;
                      case "getCroppedCanvas":
                          if (o === "image/jpeg") {
                              if (!G.option) {
                                  G.option = {}
                              }
                              G.option.fillColor = "#fff"
                          }
                          break
                  }
                  F = C[G.method](G.option, G.secondOption);
                  switch (G.method) {
                      case "rotate":
                          if (H && B.viewMode > 0) {
                              C.crop()
                          }
                          break;
                      case "scaleX":
                      case "scaleY":
                          $(this).data("option", -G.option);
                          break;
                      case "getCroppedCanvas":
                          if (F) {
                              r && r(F.toDataURL(o));
                              admin.closeDialog("#ew-crop-img")
                          } else {
                              layer.msg("裁剪失败", {
                                  icon: 2,
                                  anim: 6
                              })
                          }
                          break
                  }
              })
          }
          var A = '<div class="layui-row">';
          A += '        <div class="layui-col-sm8" style="min-height: 9rem;">';
          A += '             <img id="ew-crop-img" src="' + (w ? w : "") + '" style="max-width:100%;" />';
          A += "        </div>";
          A += '        <div class="layui-col-sm4 layui-hide-xs" style="padding: 0 20px;text-align: center;">';
          A += '             <div id="ew-crop-img-preview" style="width: 100%;height: 9rem;overflow: hidden;display: inline-block;border: 1px solid #dddddd;"></div>';
          A += "        </div>";
          A += "   </div>";
          A += '   <div class="text-center ew-crop-tool" style="padding: 15px 10px 5px 0;">';
          A += '        <div class="layui-btn-group" style="margin-bottom: 10px;margin-left: 10px;">';
          A += '             <button title="放大" data-method="zoom" data-option="0.1" class="layui-btn icon-btn" type="button"><i class="layui-icon layui-icon-add-1"></i></button>';
          A += '             <button title="缩小" data-method="zoom" data-option="-0.1" class="layui-btn icon-btn" type="button"><span style="display: inline-block;width: 12px;height: 2.5px;background: rgba(255, 255, 255, 0.9);vertical-align: middle;margin: 0 4px;"></span></button>';
          A += "        </div>";
          A += '        <div class="layui-btn-group layui-hide-xs" style="margin-bottom: 10px;">';
          A += '             <button title="向左旋转" data-method="rotate" data-option="-45" class="layui-btn icon-btn" type="button"><i class="layui-icon layui-icon-refresh-1" style="transform: rotateY(180deg) rotate(40deg);display: inline-block;"></i></button>';
          A += '             <button title="向右旋转" data-method="rotate" data-option="45" class="layui-btn icon-btn" type="button"><i class="layui-icon layui-icon-refresh-1" style="transform: rotate(30deg);display: inline-block;"></i></button>';
          A += "        </div>";
          A += '        <div class="layui-btn-group" style="margin-bottom: 10px;">';
          A += '             <button title="左移" data-method="move" data-option="-10" data-second-option="0" class="layui-btn icon-btn" type="button"><i class="layui-icon layui-icon-left"></i></button>';
          A += '             <button title="右移" data-method="move" data-option="10" data-second-option="0" class="layui-btn icon-btn" type="button"><i class="layui-icon layui-icon-right"></i></button>';
          A += '             <button title="上移" data-method="move" data-option="0" data-second-option="-10" class="layui-btn icon-btn" type="button"><i class="layui-icon layui-icon-up"></i></button>';
          A += '             <button title="下移" data-method="move" data-option="0" data-second-option="10" class="layui-btn icon-btn" type="button"><i class="layui-icon layui-icon-down"></i></button>';
          A += "        </div>";
          A += '        <div class="layui-btn-group" style="margin-bottom: 10px;">';
          A += '             <button title="左右翻转" data-method="scaleX" data-option="-1" class="layui-btn icon-btn" type="button" style="position: relative;width: 41px;"><i class="layui-icon layui-icon-triangle-r" style="position: absolute;left: 9px;top: 0;transform: rotateY(180deg);font-size: 16px;"></i><i class="layui-icon layui-icon-triangle-r" style="position: absolute; right: 3px; top: 0;font-size: 16px;"></i></button>';
          A += '             <button title="上下翻转" data-method="scaleY" data-option="-1" class="layui-btn icon-btn" type="button" style="position: relative;width: 41px;"><i class="layui-icon layui-icon-triangle-d" style="position: absolute;left: 11px;top: 6px;transform: rotateX(180deg);line-height: normal;font-size: 16px;"></i><i class="layui-icon layui-icon-triangle-d" style="position: absolute; left: 11px; top: 14px;line-height: normal;font-size: 16px;"></i></button>';
          A += "        </div>";
          A += '        <div class="layui-btn-group" style="margin-bottom: 10px;">';
          A += '             <button title="重新开始" data-method="reset" class="layui-btn icon-btn" type="button"><i class="layui-icon layui-icon-refresh"></i></button>';
          A += '             <button title="选择图片" id="ew-crop-img-upload" class="layui-btn icon-btn" type="button"><i class="layui-icon layui-icon-upload-drag"></i></button>';
          A += "        </div>";
          A += '        <button data-method="getCroppedCanvas" data-option="{ &quot;maxWidth&quot;: 4096, &quot;maxHeight&quot;: 4096 }" class="layui-btn icon-btn" type="button" style="margin-left: 10px;margin-bottom: 10px;"><i class="layui-icon">&#xe605;</i>完成</button>';
          A += "   </div>";
          admin.open({
              title: n,
              area: "665px",
              type: 1,
              content: A,
              success: function(B, C) {
                  $(B).children(".layui-layer-content").css("overflow", "visible");
                  z()
              }
          })
      })
  };
  admin.util = {
      Convert_BD09_To_GCJ02: function(o) {
          var q = (3.141592653589793 * 3000) / 180;
          var n = o.lng - 0.0065,
              s = o.lat - 0.006;
          var r = Math.sqrt(n * n + s * s) - 0.00002 * Math.sin(s * q);
          var p = Math.atan2(s, n) - 0.000003 * Math.cos(n * q);
          o.lng = r * Math.cos(p);
          o.lat = r * Math.sin(p);
          return o
      },
      Convert_GCJ02_To_BD09: function(o) {
          var q = (3.141592653589793 * 3000) / 180;
          var n = o.lng,
              s = o.lat;
          var r = Math.sqrt(n * n + s * s) + 0.00002 * Math.sin(s * q);
          var p = Math.atan2(s, n) + 0.000003 * Math.cos(n * q);
          o.lng = r * Math.cos(p) + 0.0065;
          o.lat = r * Math.sin(p) + 0.006;
          return o
      },
      animateNum: function(D, x, F, v) {
          var r = $(D);
          var s = r.text().replace(/,/g, "");
          x = x === null || x === undefined || x === true || x === "true";
          F = isNaN(F) ? 500 : F;
          v = isNaN(v) ? 100 : v;
          var z = "INPUT,TEXTAREA".indexOf(r.get(0).tagName) >= 0;
          var t = function(J) {
                  var H = "";
                  for (var I = 0; I < J.length; I++) {
                      if (!isNaN(J.charAt(I))) {
                          return H
                      } else {
                          H += J.charAt(I)
                      }
                  }
              },
              A = function(J) {
                  var H = "";
                  for (var I = J.length - 1; I >= 0; I--) {
                      if (!isNaN(J.charAt(I))) {
                          return H
                      } else {
                          H = J.charAt(I) + H
                      }
                  }
              },
              C = function(I, H) {
                  if (!H) {
                      return I
                  }
                  if (!/^[0-9]+.?[0-9]*$/.test(I)) {
                      return I
                  }
                  I = I.toString();
                  return I.replace(I.indexOf(".") > 0 ? /(\d)(?=(\d{3})+(?:\.))/g : /(\d)(?=(\d{3})+(?:$))/g, "$1,")
              };
          var G = t(s.toString());
          var p = A(s.toString());
          var q = s.toString().replace(G, "").replace(p, "");
          if (isNaN(q) || q === 0) {
              z ? r.val(s) : r.html(s);
              console.error("非法数值！");
              return
          }
          var u = q.split(".");
          var o = u[1] ? u[1].length : 0;
          var n = 0,
              y = q;
          if (Math.abs(y) > 10) {
              n = parseFloat(u[0].substring(0, u[0].length - 1) + (u[1] ? ".0" + u[1] : ""))
          }
          var w = (y - n) / v,
              E = 0;
          var B = setInterval(function() {
              var H = G + C(n.toFixed(o), x) + p;
              z ? r.val(H) : r.html(H);
              n += w;
              E++;
              if (Math.abs(n) >= Math.abs(y) || E > 5000) {
                  H = G + C(y, x) + p;
                  z ? r.val(H) : r.html(H);
                  clearInterval(B)
              }
          }, F / v)
      },
      deepClone: function(q) {
          var n;
          var o = admin.util.isClass(q);
          if (o === "Object") {
              n = {}
          } else {
              if (o === "Array") {
                  n = []
              } else {
                  return q
              }
          }
          for (var p in q) {
              var r = q[p];
              if (admin.util.isClass(r) == "Object") {
                  n[p] = arguments.callee(r)
              } else {
                  if (admin.util.isClass(r) == "Array") {
                      n[p] = arguments.callee(r)
                  } else {
                      n[p] = q[p]
                  }
              }
          }
          return n
      },
      isClass: function(n) {
          if (n === null) {
              return "Null"
          }
          if (n === undefined) {
              return "Undefined"
          }
          return Object.prototype.toString.call(n).slice(8, -1)
      },
      fullTextIsEmpty: function(q) {
          if (!q) {
              return true
          }
          var o = ["img", "audio", "video", "iframe", "object"];
          for (var n = 0; n < o.length; n++) {
              if (q.indexOf("<" + o[n]) > -1) {
                  return false
              }
          }
          var p = q.replace(/\s*/g, "");
          if (!p) {
              return true
          }
          p = p.replace(/&nbsp;/ig, "");
          if (!p) {
              return true
          }
          p = p.replace(/<[^>]+>/g, "");
          if (!p) {
              return true
          }
          return false
      }
  };
  var CLS_SIDENAVITEM = ".layui-layout-admin.admin-nav-mini>.layui-side .layui-nav .layui-nav-item";
  $(document).on("mouseenter", CLS_SIDENAVITEM + "," + CLS_SIDENAVITEM + " .layui-nav-child>dd", function() {
      if (admin.getPageWidth() > 768) {
          var o = $(this),
              q = o.find(">.layui-nav-child");
          if (q.length > 0) {
              o.addClass("admin-nav-hover");
              q.css("left", o.offset().left + o.outerWidth());
              var p = o.offset().top;
              if (p + q.outerHeight() > admin.getPageHeight()) {
                  p = p - q.outerHeight() + o.outerHeight();
                  (p < 60) && (p = 60);
                  q.addClass("show-top")
              }
              q.css("top", p);
              q.addClass("ew-anim-drop-in")
          } else {
              if (o.hasClass("layui-nav-item")) {
                  var n = o.find("cite").text();
                  layer.tips(n, o, {
                      tips: [2, "#303133"],
                      time: -1,
                      success: function(r, s) {
                          $(r).css("margin-top", "12px")
                      }
                  })
              }
          }
      }
  }).on("mouseleave", CLS_SIDENAVITEM + "," + CLS_SIDENAVITEM + " .layui-nav-child>dd", function() {
      layer.closeAll("tips");
      var o = $(this);
      o.removeClass("admin-nav-hover");
      var n = o.find(">.layui-nav-child");
      n.removeClass("show-top ew-anim-drop-in");
      n.css({
          "left": "unset",
          "top": "unset"
      })
  });
  $(document).on("click", "*[ew-event]", function() {
      var n = $(this).attr("ew-event");
      var o = admin.events[n];
      o && o.call(this, $(this))
  });
  $(document).on("mouseenter", "*[lay-tips]", function() {
      var n = $(this).attr("lay-tips");
      var o = $(this).attr("lay-direction");
      var p = $(this).attr("lay-bg");
      var q = $(this).attr("lay-offset");
      layer.tips(n, this, {
          tips: [o || 1, p || "#303133"],
          time: -1,
          success: function(r, s) {
              if (q) {
                  q = q.split(",");
                  var u = q[0],
                      t = q.length > 1 ? q[1] : undefined;
                  u && ($(r).css("margin-top", u));
                  t && ($(r).css("margin-left", t))
              }
          }
      })
  }).on("mouseleave", "*[lay-tips]", function() {
      layer.closeAll("tips")
  });
  if (admin.getPageWidth() < 768) {
      if (layui.device().os == "windows") {
          $("body").append("<style>@media screen and (max-width: 768px) {::-webkit-scrollbar{width:8px;height:9px;background:transparent}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:5px;background-color:#c1c1c1}::-webkit-scrollbar-thumb:hover{background-color:#a8a8a8}.mini-bar::-webkit-scrollbar{width:5px;height:5px}.mini-bar::-webkit-scrollbar-thumb{border-radius:3px}}</style>")
      }
  }
  $(document).on("click", "*[ew-href]", function() {
      var n = $(this).attr("ew-href");
      var o = $(this).attr("ew-title");
      o || (o = $(this).text());
      if (top.layui && top.layui.index) {
          top.layui.index.openTab({
              title: o ? o : "",
              url: n
          })
      } else {
          location.href = n
      }
  });
  var g = layui.data(admin.tableName);
  if (g && g.theme) {
      (g.theme == CLS_THEME_ADMIN) || layui.link(admin.getThemeDir() + g.theme + admin.getCssSuffix(), g.theme)
  } else {
      if (CLS_THEME_ADMIN != admin.defaultTheme) {
          layui.link(admin.getThemeDir() + admin.defaultTheme + admin.getCssSuffix(), admin.defaultTheme)
      }
  } if (!layui.contextMenu) {
      $(document).off("click.ctxMenu").on("click.ctxMenu", function() {
          try {
              var q = top.window.frames;
              for (var n = 0; n < q.length; n++) {
                  var o = q[n];
                  try {
                      (o.layui && o.layui.jquery) && o.layui.jquery("body>.ctxMenu").remove()
                  } catch (p) {}
              }
              try {
                  (top.layui && top.layui.jquery) && top.layui.jquery("body>.ctxMenu").remove()
              } catch (p) {}
          } catch (p) {}
      })
  }
  f("admin", admin)
});